<?php
require_once dirname(__FILE__).'/../model/Hqp.php';

final class ModdemoImpl
{
	static function addHqp($arr)
	{
		$hqp = new Hqp();
		//check arr logic
		$hqp->arrayToObject($arr);
		$id = $hqp->insert();
		return $id;
	}
	
	static function getHqpById($id)
	{
		$hqp = new Hqp($id);
		if ($hqp->get()) {
			return $hqp->objectToArray();
		}
		return false;
	}
	
	static function update($id,$arr)
	{
		$hqp = new Hqp($id);
		$hqp->arrayToObject($arr);
		$hqp->update();
	}
	
	static function delete($id)
	{
		$hqp = new Hqp($id);
		$hqp->delete();
	}
}
?>